diff options
| author | Adam Soltys <[email protected]> | 2023-02-02 23:26:34 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-02-02 23:29:42 -0800 |
| commit | 916f331e0e9a051830ce988639bb2149788e8228 (patch) | |
| tree | a2dc51e4f16fab464788c54dd60e6c18dc8923b0 /src/routes/(app)/invoice/[hash]/+layout.server.js | |
| parent | 8ebbc178b68da89470bac68f65a365bc6366747b (diff) | |
| download | coinos-ui-916f331e0e9a051830ce988639bb2149788e8228.tar.gz coinos-ui-916f331e0e9a051830ce988639bb2149788e8228.zip | |
move invoices, combine profile and dashboard
Diffstat (limited to 'src/routes/(app)/invoice/[hash]/+layout.server.js')
| -rw-r--r-- | src/routes/(app)/invoice/[hash]/+layout.server.js | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/src/routes/(app)/invoice/[hash]/+layout.server.js b/src/routes/(app)/invoice/[hash]/+layout.server.js deleted file mode 100644 index d38f945f..00000000 --- a/src/routes/(app)/invoice/[hash]/+layout.server.js +++ /dev/null @@ -1,19 +0,0 @@ -import Qr from 'qrcode-base64'; -import { get } from '$lib/utils'; -import { redirect } from '@sveltejs/kit'; - -export async function load({ depends, params, url }) { - depends('app:invoice'); - - let { hash } = params; - let invoice = await get(`/invoice/${hash}`); - let { amount, received } = invoice; - amount = parseInt(amount); - - let paid = (!amount && received) || (amount > 0 && received >= amount); - if (paid && !url.pathname.endsWith('paid')) throw redirect(307, `/invoice/${hash}/paid`); - - let sm = Qr.drawImg(invoice.text, { size: 300 }); - - return { hash, invoice, sm, lg: sm }; -} |
